package org.exez.modules.visitor.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.exez.common.api.vo.Result;
import org.exez.common.aspect.annotation.AutoLog;
import org.exez.common.constant.CommonConstant;
import org.exez.common.system.base.controller.JeecgController;
import org.exez.common.system.util.JwtUtil;
import org.exez.common.util.PasswordUtil;
import org.exez.common.util.RedisUtil;
import org.exez.modules.system.entity.SysUser;
import org.exez.modules.system.model.SysLoginModel;
import org.exez.modules.system.service.ISysUserService;
import org.exez.modules.system.vo.SysLoginUserVO;
import org.exez.modules.visitor.dto.ReservationApplicationDTO;
import org.exez.modules.visitor.entity.Institution;
import org.exez.modules.visitor.entity.ReservationApplication;
import org.exez.modules.visitor.service.IReservationApplicationService;
import org.exez.modules.visitor.service.SjyService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Description: 到访类型表
 * @Author: exez-boot
 * @Date: 2020-06-04
 * @Version: V1.0
 */
@Slf4j
@Api(tags = "外侧系统数据传输")
@RestController
@RequestMapping("/api/visitor")
public class ApiController extends JeecgController<ReservationApplication, IReservationApplicationService> {

    @Autowired
    private IReservationApplicationService reservationApplicationService;
    /**
     * 数据传输
     *
     * @param reservationApplicationDTOs
     * @return
     */
    @AutoLog(value = "数据传输")
    @ApiOperation(value = "数据传输", notes = "数据传输")
    @PostMapping(value = "/dataTransmission")
    public Result<?> dataTransmission(@RequestBody List<ReservationApplicationDTO> reservationApplicationDTOs) {

        reservationApplicationService.dataTransmission(reservationApplicationDTOs);

        return Result.ok("添加成功！");
    }
    /**
     * 外侧数据同步内侧测试
     * @return
     */
    @AutoLog(value = "外侧数据同步内侧测试")
    @ApiOperation(value = "外侧数据同步内侧测试", notes = "外侧数据同步内侧测试")
    @PostMapping(value = "/test1111")
    public Result<?> test1111() {

        reservationApplicationService.dataTransmission();

        return Result.ok("添加成功！");
    }




}
